/* 
 * GrayRabbit Cms基于J2EE架构内容管理系统
 * Copyright © GrayRabbit Co., Ltd. All rights reserved.
 * Department：运营部
 * 更多信息，请visit:
 * http://code.google.com/p/gray-rabbit-cms/
 */
package org.grayrabbit.cms.dao.plugins; 

import java.util.List;

import org.grayrabbit.cms.entity.Survey;
import org.grayrabbit.cms.vo.plugins.SurveyBean;

import org.grayrabbit.dao.GenericDao;
import org.grayrabbit.dao.util.Page;
import org.grayrabbit.dao.util.QueryCondition;

/**
 * <b>Survey</b>的DAO接口

 * @version 1.0,创建时间:2011-05-16 16:08:59 
 */
public interface SurveyDao extends GenericDao<Survey, String>{
	
	/**
	 * 根据bean组装查询条件
	 */
	public QueryCondition assembly(SurveyBean bean);
	/**
	 * 根据bean组装统计查询条件
	 */
	public QueryCondition assemblyCount(SurveyBean bean);
	public int count(SurveyBean bean);
	/**
	 * 根据bean组装查询条件(名称参数)
	 */
	public QueryCondition assermblyNameQuery(SurveyBean bean);
	
	/**
	 * 根据bean组装统计查询条件(名称参数)
	 */
	public QueryCondition assemblyNameQueryCount(SurveyBean bean);
	/**
	 * 填充分页组件
	 * @param page
	 * @param bean
	 */
	public List<Survey> findByPage(Page<Survey> page, SurveyBean bean);
	/**
	 * 检查唯一性
	 * @param role
	 * @return
	 */
	public Boolean checkNameUnique(String surveyTitle,String surname,String siteId);
	
	public List<Survey> ListAll(SurveyBean bean);
	public List<Survey> findPublishBySiteId(String siteId,
			int currentSurveryIndex, int max);
	/**
	 * 查询所有记录
	 */
	public List<Survey> surList();
	
	/**
	 * 根据站点ID查询
	 * @return
	 */
	public List<Survey>findBySiteId(String siteId);
}